/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80031 (8.0.31)
 Source Host           : localhost:3306
 Source Schema         : basic_project

 Target Server Type    : MySQL
 Target Server Version : 80031 (8.0.31)
 File Encoding         : 65001

 Date: 10/03/2025 15:25:43
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_api_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_api_log`;
CREATE TABLE `sys_api_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `operation` varchar(50) DEFAULT NULL COMMENT '操作描述',
  `method` varchar(255) DEFAULT NULL COMMENT '方法名（类名+方法名）',
  `params` varchar(1000) DEFAULT NULL COMMENT '请求参数（JSON格式）',
  `ip` varchar(25) DEFAULT NULL COMMENT '调用者IP',
  `duration` int DEFAULT NULL COMMENT '执行耗时（毫秒）',
  `has_exception` int DEFAULT NULL COMMENT '是否发生异常',
  `exception_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '异常信息',
  `douser` varchar(25) DEFAULT NULL COMMENT '调用者帐号',
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_api_log
-- ----------------------------
BEGIN;
INSERT INTO `sys_api_log` (`id`, `operation`, `method`, `params`, `ip`, `duration`, `has_exception`, `exception_msg`, `douser`, `dotime`) VALUES (15, '登录', 'cn.luke.basic.controller.ControllerAuth#login', '{\"params\":{\"username\":\"root\"}}', '127.0.0.1', 242, 0, NULL, 'guest', '2025-03-10 14:24:26');
COMMIT;

-- ----------------------------
-- Table structure for sys_dic
-- ----------------------------
DROP TABLE IF EXISTS `sys_dic`;
CREATE TABLE `sys_dic` (
  `dic_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典编号',
  `dic_value` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典值',
  `param_mark` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '参数字段,用于记录字典值的部分特殊属性',
  `pid` int DEFAULT '0' COMMENT '级联父ID',
  `show_order` int DEFAULT '0' COMMENT '显示顺序(越大越前)',
  `flag_system` int DEFAULT '0' COMMENT '系统标识,1无法删除或编辑',
  `status` int DEFAULT '0' COMMENT '状态,0启用1禁用',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `id` int NOT NULL AUTO_INCREMENT,
  `douser` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=187 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Base-字典数据内容';

-- ----------------------------
-- Records of sys_dic
-- ----------------------------
BEGIN;
INSERT INTO `sys_dic` (`dic_code`, `dic_value`, `param_mark`, `pid`, `show_order`, `flag_system`, `status`, `remark`, `id`, `douser`, `dotime`, `uptime`) VALUES ('warehouse', '原料仓', '', 0, 0, 0, 0, '', 182, 'root', '2025-03-09 10:43:42', NULL);
INSERT INTO `sys_dic` (`dic_code`, `dic_value`, `param_mark`, `pid`, `show_order`, `flag_system`, `status`, `remark`, `id`, `douser`, `dotime`, `uptime`) VALUES ('warehouse', '成品仓', '', 0, 0, 0, 0, '', 183, 'root', '2025-03-09 10:43:42', NULL);
INSERT INTO `sys_dic` (`dic_code`, `dic_value`, `param_mark`, `pid`, `show_order`, `flag_system`, `status`, `remark`, `id`, `douser`, `dotime`, `uptime`) VALUES ('unit', 'Pcs', '', 1, 1, 0, 0, 'test', 184, 'root', '2025-03-09 10:52:15', '2025-03-09 10:55:59');
INSERT INTO `sys_dic` (`dic_code`, `dic_value`, `param_mark`, `pid`, `show_order`, `flag_system`, `status`, `remark`, `id`, `douser`, `dotime`, `uptime`) VALUES ('unit', 'Kg', '', 0, 0, 0, 0, '', 185, 'root', '2025-03-09 10:52:15', NULL);
INSERT INTO `sys_dic` (`dic_code`, `dic_value`, `param_mark`, `pid`, `show_order`, `flag_system`, `status`, `remark`, `id`, `douser`, `dotime`, `uptime`) VALUES ('unit', 'g', '', 0, 0, 0, 0, '', 186, 'root', '2025-03-09 10:52:15', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_dic_catalog
-- ----------------------------
DROP TABLE IF EXISTS `sys_dic_catalog`;
CREATE TABLE `sys_dic_catalog` (
  `dic_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典类型',
  `dic_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典编码',
  `dic_mark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '字典说明',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `status` int DEFAULT '0' COMMENT '状态,0启用,1禁用',
  `flag_system` int DEFAULT '0' COMMENT '系统标识,1不可见',
  `id` int NOT NULL AUTO_INCREMENT,
  `douser` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Base-字典目录表';

-- ----------------------------
-- Records of sys_dic_catalog
-- ----------------------------
BEGIN;
INSERT INTO `sys_dic_catalog` (`dic_type`, `dic_code`, `dic_mark`, `remark`, `status`, `flag_system`, `id`, `douser`, `dotime`, `uptime`) VALUES ('基础', 'unit', '单位', '', 0, 0, 1, '', '2024-06-14 17:28:05', '2024-08-02 13:44:59');
INSERT INTO `sys_dic_catalog` (`dic_type`, `dic_code`, `dic_mark`, `remark`, `status`, `flag_system`, `id`, `douser`, `dotime`, `uptime`) VALUES ('仓库', 'warehouse', '仓库', '', 0, 0, 3, '', '2024-06-14 17:29:57', '2025-03-09 10:40:37');
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` int NOT NULL AUTO_INCREMENT,
  `perm_name` varchar(100) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `pid` int DEFAULT NULL,
  `show_order` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `permNameIndex` (`perm_name`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (1, 'role', '角色管理', 0, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (2, 'role.add', '创建角色', 1, 90);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (3, 'role.update', '编辑角色', 1, 85);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (4, 'role.delete', '删除角色', 1, 80);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (5, 'role.search', '角色列表查询', 1, 100);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (6, 'user', '用户管理', 0, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (7, 'user.register', '创建用户', 6, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (8, 'user.page', '查询用户', 6, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (9, 'userRole.add', '角色用户管理', 1, 70);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (10, 'user.manager', '启禁用用户', 6, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (12, 'user.upPasswordManager', '修改密码(管理员)', 6, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (13, 'dic', '字典管理', 0, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (14, 'dic.search', '字典查询', 13, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (15, 'dic.add', '添加字典', 13, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (16, 'dic.update', '编辑字典', 13, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (17, 'dic.manager', '启禁用字典', 13, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (19, 'rolePermission.add', '角色权限管理', 1, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (20, 'rolePermission.search', '角色权限查询', 1, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (21, 'set', '系统设置', NULL, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (22, 'set.save', '保存设置', NULL, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (23, 'set.search', '查询设置', NULL, 0);
INSERT INTO `sys_permission` (`id`, `perm_name`, `description`, `pid`, `show_order`) VALUES (24, 'set.logout', '强制注销指定用户', NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `role_name` varchar(50) NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `douser` varchar(25) DEFAULT NULL,
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roleNameIndex` (`role_name`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `douser`, `dotime`, `uptime`) VALUES (1, '超级管理员', '内置', 'root', '2025-03-08 17:18:35', '2025-03-08 22:15:24');
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `douser`, `dotime`, `uptime`) VALUES (7, 'test2', '测试', 'root', '2025-03-08 17:19:07', NULL);
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `douser`, `dotime`, `uptime`) VALUES (9, 'test4', '测试4', 'root', '2025-03-08 21:48:45', NULL);
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `douser`, `dotime`, `uptime`) VALUES (10, 'test5', '测试4', 'root', '2025-03-10 14:25:28', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `role_id` int NOT NULL,
  `permission_id` int NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `douser` varchar(25) DEFAULT NULL,
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `id` int NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 1, NULL, 'root', '2025-03-08 21:04:37', NULL, 4);
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 2, NULL, 'root', '2025-03-08 21:04:37', NULL, 5);
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 3, NULL, 'root', '2025-03-08 21:04:37', NULL, 6);
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 4, NULL, 'root', '2025-03-08 21:04:37', NULL, 7);
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 8, NULL, NULL, '2025-03-08 21:50:09', NULL, 12);
INSERT INTO `sys_role_permission` (`role_id`, `permission_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (4, 1, NULL, NULL, '2025-03-08 22:14:49', NULL, 13);
COMMIT;

-- ----------------------------
-- Table structure for sys_set
-- ----------------------------
DROP TABLE IF EXISTS `sys_set`;
CREATE TABLE `sys_set` (
  `set_mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '设置描述',
  `set_key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '设置Key',
  `set_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '设置内容',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `show_order` int DEFAULT '0' COMMENT '显示顺序',
  `id` int NOT NULL AUTO_INCREMENT,
  `douser` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Base-系统全局设置';

-- ----------------------------
-- Records of sys_set
-- ----------------------------
BEGIN;
INSERT INTO `sys_set` (`set_mark`, `set_key`, `set_value`, `remark`, `show_order`, `id`, `douser`, `dotime`, `uptime`) VALUES ('OTA升级地址', 'ota_update_address', 'aaaa', 'etst', 0, 9, 'root', '2025-03-09 11:34:15', '2025-03-09 11:41:07');
INSERT INTO `sys_set` (`set_mark`, `set_key`, `set_value`, `remark`, `show_order`, `id`, `douser`, `dotime`, `uptime`) VALUES ('最后版本', 'last_version', 'V1.1', '', 0, 10, '', '2025-03-09 11:34:59', '2025-03-09 11:35:10');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varchar(100) NOT NULL,
  `nick` varchar(25) DEFAULT NULL,
  `status` int DEFAULT '0' COMMENT '状态,0启用,1禁用',
  `remark` varchar(255) DEFAULT NULL,
  `douser` varchar(25) DEFAULT NULL,
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `nick`, `status`, `remark`, `douser`, `dotime`, `uptime`) VALUES (1, 'root', '$2a$10$vm5cTsu1cCqr2pBeqvPKq.O8YCJtqirKj.lypFsFq0ZJUOiZZ5DYq', '超级管理员', 0, NULL, NULL, '2025-03-08 18:23:55', '2025-03-08 22:21:10');
INSERT INTO `sys_user` (`id`, `username`, `password`, `nick`, `status`, `remark`, `douser`, `dotime`, `uptime`) VALUES (7, 'luke', '$2a$10$deIy.ysMPoIKdHIsoyQWFesR2jotvroMx5xUcA1k967x0N5DNictO', '张三', 0, '测试', NULL, '2025-03-08 18:23:55', '2025-03-08 22:41:14');
INSERT INTO `sys_user` (`id`, `username`, `password`, `nick`, `status`, `remark`, `douser`, `dotime`, `uptime`) VALUES (8, 'luke1', '$2a$10$lVXJ5XB8k5PRkYxOfWXNcOyolSyCmEPdBNn1YLBVIqyglUDoorSZy', NULL, 0, NULL, NULL, '2025-03-08 18:23:55', NULL);
INSERT INTO `sys_user` (`id`, `username`, `password`, `nick`, `status`, `remark`, `douser`, `dotime`, `uptime`) VALUES (10, 'luke4', '$2a$10$LW1W8etS2Rpj/W10KEPC9ey3yS.nbI5Z2jqqgHdEa96Tz.kMGGipS', NULL, 0, NULL, NULL, '2025-03-08 21:28:41', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `user_id` int NOT NULL,
  `role_id` int NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `douser` varchar(25) DEFAULT NULL,
  `dotime` datetime DEFAULT CURRENT_TIMESTAMP,
  `uptime` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `id` int NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`user_id`, `role_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (1, 4, NULL, 'root', '2025-03-08 19:01:35', NULL, 2);
INSERT INTO `sys_user_role` (`user_id`, `role_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (7, 4, NULL, 'root', '2025-03-08 19:01:35', NULL, 3);
INSERT INTO `sys_user_role` (`user_id`, `role_id`, `remark`, `douser`, `dotime`, `uptime`, `id`) VALUES (7, 7, NULL, 'root', '2025-03-08 21:22:52', '2025-03-08 21:22:57', 4);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
